﻿#pragma once
// Copyright (c) lanyeo 2020-2021
// Licenced under MIT license. See https://opensource.org/licenses/MIT for details.
// code style
// 1. use forward declaration (尽可能使用前置声明)
// 2. include file sequence [other project>c>c++>third>self project]
//
#include <util/fist-time-inl.h>

#include <cppcoro/task.hpp>

#include "db_interface.h"

class CDBConfParser;
class IDBOperator;

class CDBManager : public IDBManager
{
MANAGER_INFO(IDBManager)
public:
    CDBManager();

    bool Init() override;

    void Update() override;

    void Destroy() override;

    virtual ~CDBManager();

    const DBConf *conf() override;

private:
    void DBTest();
    cppcoro::task<> CoDBTest();
private:
    CDBConfParser* m_cfg_parser;
    IDBOperator* m_db;
    fist::ms_t m_last_test;
};

